<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./axios.js"></script>
</head>

<body>
  <script src="../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {},
      created() {
        this.fetchData();
      },
      methods: {
        fetchData() {
          // post方法接受三个参数，第一个是url，第二个是请求参数，第三个参数是config
          axios.post(url,
          {
            name: '白粉花',
            gender: '女'
          },
          {
            header: {
              'content-type':'application/json'
            }
          }
          ).then(res=>{}).catch(err=>{})
        }
      }
    })
  </script>
</body>

</html>